<div class="contentTitle">Feedback</div>


<div id="uResult">

<p>Your feedback is highly appreciated.</p>
<br />

<form id="uFeedbackForm" name="uFeedbackForm" action="" method="post">

<center>
<div style="text-align: left; width:300px;">
<label for="email">Your Email (Optional)</label>
<input type="text" name="email" id="email" data-inline="false" value="" />
<br />


<label for="message">Message:</label>
<textarea name="message" id="message" data-inline="false"></textarea>
</div>
</center>

<br/><br/>
<a href="" data-rel="back" data-icon="delete" data-inline="true" data-theme="b" data-role="button">Cancel</a>    
<input type="button" onclick="doFeedbackSubmit();" data-inline="true" value="Submit" data-theme="b"/>
</form>

</div>

<br />

<script>

function doFeedbackSubmit() {        
    var form = $('#uFeedbackForm');
    var email = form.find( 'input[name="email"]' ).val();
    var message = form.find( 'textarea[name="message"]' ).val();
    
    if ( !email && !message ) {
    	alert('Please enter message');
    	return;
    }
    
    $.post('../php/feedback.php', {email: email, message: message},
      function( data ) {    
    	$('#uResult').html(data).trigger("create");
      }
    );
}
</script>


